<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<!--       
*     Copyright (c) 2008 Sun Microsystems, Inc. All rights reserved.
*     Use is subject to license terms.
-->
<html>
<head>
	<title>Rename a Class</title>
<link href="nbdocs:/org/netbeans/modules/usersguide/ide.css"  rel="stylesheet" type="text/css"></head>
<body>
<h2><b>Rename</b> a Class</h2>
<p> <small><a href="#seealso">See Also</a></small> 


<p><b>To rename a class and change the code that references that class: </b></p>
<ol>
<li>In the Projects window or Source editor, right-click the class and choose Refactor > Rename  from the  contextual menu.</li>
<li>In the Rename Class dialog box, type the New Name.<br/> 
Select the Apply Rename on Comments checkbox to apply renaming on all occurrences of that class in the comments.</li>
<li>To apply the changes to the code, do one of the following:
  <ul>
<li>Click the Refactor button.<br>
    The IDE instantly applies all the changes. </li>
<li>Click the Preview button.<br>
    The Refactoring window displays all lines of code that will be changed. Review the changes and clear the checkbox for any code that you do not want to change. Click the Do Refactoring button to apply the changes. </li>
</ul>
</ol>

<dl>
<dt><a name="seealso">See Also</a></dt>
<dd><a href="refactor_quick_ref.html">Refactoring: Quick Reference </a></dd>
<dd><a href="rename_function_var.html">Renaming a Function or Variable </a></dd>
<dd><a href="undo_refactor_changes.html">Undoing Refactoring Changes</a></dd>
</dl>

<hr>
<p><font size=-2><a href="../credits.html">Legal Notices</a></font>
</p>
<table cellpadding="50" border="0">
  <tr>
    <td>&nbsp;</td>
  </tr>
</table>

</body>
</html>
